﻿using CKS.Core.Framework.Models;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace Infrastructure
{
    public static class InternalApp
    {
        /// <summary>
        /// 应用服务
        /// </summary>
        public static IServiceProvider ServiceProvider;
        public static IServiceProvider JobProvider;
        /// <summary>
        /// 全局配置构建器
        /// </summary>
        public static IConfiguration Configuration;

        /// <summary>
        /// 获取Web主机环境
        /// </summary>
        public static IWebHostEnvironment WebHostEnvironment;

        public static WebApplication App { get; set; }
        public static IServiceCollection Services { get; set; }

        /// <summary>
        /// 获取泛型主机环境
        /// </summary>
        //public static IHostEnvironment HostEnvironment;

        /// <summary>
        /// OP90上次实时采集保存时间
        /// </summary>
        public static DateTime LastOP90RealtimeCollectionTime { get; set; } = Infrastructure.App.MinTime;
        public static IFreeSql<MesDB> Fsql { get; set; }
    }
}
